#ifndef LED_CONTROL_H
#define LED_CONTROL_H

#define LED_BUILTIN1 0
#define LED_BUILTIN2 2
#include <ESP8266WebServer.h>

extern ESP8266WebServer esp8266_server; // 引用在 main.ino 中实例化的 esp8266_server

void handleLEDControl()
{
  bool ledStatus = digitalRead(LED_BUILTIN1);
  digitalWrite(LED_BUILTIN1, !ledStatus);
  digitalWrite(LED_BUILTIN2, !ledStatus);
  esp8266_server.sendHeader("Location", "/LED.html");
  esp8266_server.send(303);
}

#endif
